﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using pinche_api.Models;

namespace pinche_api.Data {
    public class SQLiteContext:DbContext, IDisposable {
        public SQLiteContext(DbContextOptions<SQLiteContext> options)
          : base(options) {
        }
        public DbSet<User> User { get; set; }
        public DbSet<Carpool> Carpool { get; set; }
        public DbSet<News> News { get; set; }
        public DbSet<Classify> Classify { get; set; }
        protected override void OnModelCreating(ModelBuilder modelBuilder) {
            modelBuilder.Entity<User>().ToTable("USER");
            modelBuilder.Entity<Carpool>().ToTable("CARPOOL");
            modelBuilder.Entity<Classify>().ToTable("CLASSIFY");
            modelBuilder.Entity<News>().ToTable("NEWS");
        }
        public void Dispose() {
            base.Dispose();
        }
    }
}
